const express = require('express')
const article = express.Router()
const {getArticle,postUpdateStatus,postArticle, getUserArticle,getArticleID, postDleteArticle, postUpdateArticle, getCountArticle, postSearchArticle} = require('../../service/article/articleService') 


//获取文章数据
article.get('/',getArticle)
//发布文章
article.post('/',postArticle)
article.post('/status',postUpdateStatus)

//查询文章
article.post('/search',postSearchArticle)

//获取用户发布文章
article.get('/user',getUserArticle)

//根据id获取文章
article.get('/id',getArticleID)

//删除文章
article.post('/delete',postDleteArticle)

//修改文章
article.post('/update',postUpdateArticle)

//统计作者文章发布数
article.get('/count',getCountArticle)

module.exports = article